package com.jzy.api;

import com.jzy.bean.DemoResponse;
import com.jzy.bean.User;
import com.jzy.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * ${DESCRIPTION}
 *
 * @author jzy
 * @create 2018-05-11 14:46
 **/
@RestController
@Api(description = "用户模块", tags = {"用户模块接口控制层"})
@RequestMapping(value = "/user")
public class UserController {

    @Autowired
    UserService userService;


    @RequestMapping(value = "/v1/add", method = RequestMethod.POST)
    @ApiOperation(value = "添加用户信息", httpMethod = "POST", response = DemoResponse.class)
    public DemoResponse addUser(@RequestBody User addVo) throws Exception {
        userService.addUser(addVo);
        return new DemoResponse();
    }


    @RequestMapping(value = "/v1/test", method = RequestMethod.GET)
    @ApiOperation(value = "测试", httpMethod = "GET", response = DemoResponse.class)
    public String test(){
        System.out.println("2222");
        return "/index";
    }
    
   
    @GetMapping("/hello")
    public void hell() {
    	System.out.println("哇哈哈！！！！");
    }
}
